<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表单域</title>
</head>
<body>
<form action="#" method="get">

    <label>用户名</label><input name="username" value="admin"/> <!--默认类型 type=text-->
    <label>密码</label><input name="password" type="password" value="123"/>
    <input type="checkbox" value="1" name="likes"/>
    <input type="radio" value="1"/>
    <input type="hidden" value="1"/>
    <textarea rows="2"></textarea>

    <select>
        <option>天津</option>
        <option>北京</option>
    </select>


</form>

<button id="btnGetValue">获取值</button>
</body>

<script>

  var like=  document.getElementsByName('likes')[0].value;

  console.log(like)

</script>
</html>